package club.mzywucai.blog.file_system.controller;

import club.mzywucai.blog.file_system.pojo.domain.ChangeImageAndSentence;
import club.mzywucai.blog.file_system.pojo.domain.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author mzywucai
 * @Description
 * @date 2019/4/2
 */
@RestController
public class ChangeImageAndSentenceController {
    @Autowired
    ChangeImageAndSentence changeImageAndSentence;

    @RequestMapping("/api/get-background")
    public Object getBackground() {
        return JsonData.buildSuccess(0, changeImageAndSentence.getBackground(), "success");
    }

    @RequestMapping("/api/get-sentence-and-image")
    public Object getIndexImageAndSentence() {
        String sentence = changeImageAndSentence.getSentence();
        String image = changeImageAndSentence.getIndexImage();

        return JsonData.buildSuccess(0, new String[]{image, sentence}, "success");
    }


}
